import Vue from 'vue'
import Vuex from 'vuex'
import persistedState from 'vuex-persistedstate'

import goods from './modules/goods'
import cart from './modules/cart'
import cata from './modules/cata.js'
import me from './modules/me.js'
import addres from './modules/addres.js'
Vue.use(Vuex)

export default new Vuex.Store({
  plugins:[
    persistedState({
      // storage:window.sessionStorage
	  storage: {
	  				getItem: key => uni.getStorageSync(key),
	  				setItem: (key, value) => uni.setStorageSync(key, value),
	  				removeItem: key => uni.removeStorageSync(key)
	  			}
    })
  ],
  modules: {
    goods,
    cart,
	cata,
	me,
	addres
  }
})
